package com.ufgov.agcfs.taskPreset.web;

import java.io.FileOutputStream;





import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;












import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ufgov.agcfs.taskPreset.entity.AgcfsSjAccAssEntity;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjAccBook;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjAccEntity;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjAccPeriod;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjAssetChangeTypeEntity;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjAssetStatusEntity;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjAssetTypeEntity;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjBank;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjCurEntity;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjDept;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjEmpType;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjExchangeTypeEntity;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjGlDefEntity;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjProj;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjSettlement;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjUserDefDoc;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjUserDefDocValEntity;
import com.ufgov.agcfs.taskPreset.entity.AgcfsSjVouTypeEntity;
import com.ufgov.agcfs.taskPreset.service.AgcfsSjAccBookService;





@Controller
@RequestMapping("/select")
public class AgcfsSjAccBookController {
	@Autowired
	AgcfsSjAccBookService agcfsSjAccBookService;
	

	public AgcfsSjAccBookService getAgcfsSjAccBookService() {
		return agcfsSjAccBookService;
	}


	public void setAgcfsSjAccBookService(AgcfsSjAccBookService agcfsSjAccBookService) {
		this.agcfsSjAccBookService = agcfsSjAccBookService;
	}



	//输出流
	FileOutputStream fos;
	
	@RequestMapping(value="/get", method= RequestMethod.POST)
	public @ResponseBody Map<String,Object> getAllYears(){
		Map<String,Object> result = new HashMap<String,Object>();
		try{
			
			List<String>  res=agcfsSjAccBookService.queryYears();
			result.put("data", res);
			result.put("flag","success");
		}catch(Exception e){
			result.put("flag","error");
		}
		
		return result;
	}
	
	//只查询部门的名称
		@RequestMapping(value="/coNameInfo",method=RequestMethod.GET)
		public @ResponseBody Map<String,Object> queryCoName(HttpServletRequest request,HttpServletResponse response){
			Map<String, Object> result =new HashMap<String, Object>();
			 
			List<String> data=agcfsSjAccBookService.selectCoName();
			if(data!=null){
				result.put("data", data);
				result.put("flag", "success");
				result.put("msg", "查询成功!");
			}else{
				result.put("flag", "fail");
				result.put("msg", "查询失败!");
			}
			return result;
		}
		
		//导出excel文件
		@RequestMapping(value="/outExcelFile" ,method=RequestMethod.POST)
		public @ResponseBody boolean outExcelFile(HttpServletRequest request,HttpServletResponse response) throws IOException{
			
			String coName=request.getParameter("CO_NAME");
			String ND=request.getParameter("ND"); 
			String queryTable=request.getParameter("queryTable"); 
			
			if(queryTable.equals("电子账簿")){
			if(agcfsSjAccBookService.outExcelFile1(ND, coName)){
				return true;
			}
			
			return false;
		}
		if(queryTable.equals("会计期间")){
			 if(agcfsSjAccBookService.outExcelFile2(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("银行账户")){
			 if(agcfsSjAccBookService.outExcelFile3(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("结算方式")){
			 if(agcfsSjAccBookService.outExcelFile4(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("内设机构")){
			 if(agcfsSjAccBookService.outExcelFile5(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("职工类型")){
			 if(agcfsSjAccBookService.outExcelFile6(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("项目")){
			 if(agcfsSjAccBookService.outExcelFile7(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("自定义档案项")){
			 if(agcfsSjAccBookService.outExcelFile8(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("自定义档案值")){
			 if(agcfsSjAccBookService.outExcelFile9(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("币种")){
			 if(agcfsSjAccBookService.outExcelFile10(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("汇率类型")){
			 if(agcfsSjAccBookService.outExcelFile11(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("总账基础信息")){
			 if(agcfsSjAccBookService.outExcelFile12(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("记账凭证类型")){
			 if(agcfsSjAccBookService.outExcelFile13(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("会计科目")){
			 if(agcfsSjAccBookService.outExcelFile14(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("科目辅助核算")){
			 if(agcfsSjAccBookService.outExcelFile15(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("固定资产类别")){
			 if(agcfsSjAccBookService.outExcelFile16(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("固定资产变动方式")){
			 if(agcfsSjAccBookService.outExcelFile17(ND, coName)){
				return true;
			}
			return false;
		}
		if(queryTable.equals("固定资产使用状况")){
			 if(agcfsSjAccBookService.outExcelFile18(ND, coName)){
				return true;
			}
			return false;
		}
		return false;
		
		}
	
		
	
	//查询电子帐薄信息
	@RequestMapping(value="/accBookInfo",method=RequestMethod.GET)
	public @ResponseBody Map<String,Object> queryAccBookInfo(HttpServletRequest request,HttpServletResponse response){
		Map<String, Object> result=new HashMap<String, Object>();
		//String coName="ert";
		String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
		System.out.println(coName);
		//String ND="2015";
		String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
		
			String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
			System.out.println(DW_CODE);
			Map<String,Object> param=new HashMap<String, Object>();
			param.put("DW_CODE", DW_CODE);
			param.put("ND", ND);
		List<AgcfsSjAccBook> data=agcfsSjAccBookService.selectSjAccBookInfo(param);
		if(data!=null){
			result.put("data", data);
			result.put("flag", "success");
			result.put("msg", "查询成功！");
			
		}else{
			result.put("flag", "fail");
			result.put("msg", "查询失败！");			
		}
		return result;
	}
	
	/*
	//查询单位代码、单位名称、上级单位代码
	@RequestMapping(value="/dwinfo",method=RequestMethod.POST)
	public @ResponseBody Map<String , Object> queryDwInfo(HttpServletRequest request,HttpServletResponse response){
		Map<String , Object> result =new HashMap<String, Object>();
		String coName=request.getParameter("coName"); //从前端请求获取co_name数据，名字保持一致
		List<IpCompany> data =agcfsSjAccBookService.selectIpCompInfo();
		if(data!=null){
			result.put("data", data);
			result.put("msg", "success");
			result.put("flag", "查询成功！");
		}else{
			result.put("msg", "fail");
			result.put("flag", "查询失败！");
		}
		return result;		
	}
*/

	//查询会计期间全部信息
	@RequestMapping(value="/accPeriodInfo",method=RequestMethod.GET)
	public @ResponseBody Map<String,Object> queryAccPeriodInfo(HttpServletRequest request,HttpServletResponse response,Model model ){
		Map<String, Object> result=new HashMap<String, Object>();
		//String coName="ert";
		String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
		System.out.println(coName);
		//String ND="2015";
		String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
		
			String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
			System.out.println(DW_CODE);
			Map<String,Object> param=new HashMap<String, Object>();
			param.put("DW_CODE", DW_CODE);
			param.put("ND", ND);
		List<AgcfsSjAccPeriod> data=agcfsSjAccBookService.selectSjAccPeriod(param);
		if(data!=null){
			result.put("data", data);
			result.put("flag", "success");
			result.put("msg", "查询成功！");
			
		}else{
			result.put("flag", "fail");
			result.put("msg", "查询失败！");			
		}
		return result;
	}
	//查询银行账户全部信息
	@RequestMapping(value="/accBankInfo",method=RequestMethod.GET)
	public @ResponseBody Map<String,Object> queryAccBankInfo(HttpServletRequest request,HttpServletResponse response,Model model ){
		Map<String, Object> result=new HashMap<String, Object>();
		//String coName="ert";
		String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
		System.out.println(coName);
		//String ND="2015";
		String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
	
			String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
			System.out.println(DW_CODE);
			Map<String,Object> param=new HashMap<String, Object>();
			param.put("DW_CODE", DW_CODE);
			param.put("ND", ND);
			List<AgcfsSjBank> data=agcfsSjAccBookService.selectSjAccBank(param);
		if(data!=null){
			result.put("data", data);
			result.put("flag", "success");
			result.put("msg", "查询成功！");
			
		}else{
			result.put("flag", "fail");
			result.put("msg", "查询失败！");			
		}
		return result;
	}
	//查询结算方式全部信息
	@RequestMapping(value="/agcfsSettlementInfo",method=RequestMethod.GET)
	public @ResponseBody Map<String,Object> queryAccSettlementInfo(HttpServletRequest request,HttpServletResponse response,Model model ){
		Map<String, Object> result=new HashMap<String, Object>();
		//String coName="ert";
		String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
		System.out.println(coName);
		//String ND="2015";
		String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
	
			String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
			System.out.println(DW_CODE);
			Map<String,Object> param=new HashMap<String, Object>();
			param.put("DW_CODE", DW_CODE);
			param.put("ND", ND);
			List<AgcfsSjSettlement> data=agcfsSjAccBookService.selectSjSettlement(param);
		if(data!=null){
			result.put("data", data);
			result.put("flag", "success");
			result.put("msg", "查询成功！");
			
		}else{
			result.put("flag", "fail");
			result.put("msg", "查询失败！");			
		}
		return result;
	}
	//查询内设机构全部信息
		@RequestMapping(value="/agcfsSjDeptInfo",method=RequestMethod.GET)
		public @ResponseBody Map<String,Object> queryAgcfsSjDept(HttpServletRequest request,HttpServletResponse response,Model model ){
			Map<String, Object> result=new HashMap<String, Object>();
			//String coName="ert";
			String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
			System.out.println(coName);
			//String ND="2015";
			String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
		
				String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
				System.out.println(DW_CODE);
				Map<String,Object> param=new HashMap<String, Object>();
				param.put("DW_CODE", DW_CODE);
				param.put("ND", ND);
				List<AgcfsSjDept> data=agcfsSjAccBookService.selectAgcfsSjDept(param);
			if(data!=null){
				result.put("data", data);
				result.put("flag", "success");
				result.put("msg", "查询成功！");
				
			}else{
				result.put("flag", "fail");
				result.put("msg", "查询失败！");			
			}
			return result;
		}
		//查询职工类型全部信息
				@RequestMapping(value="/agcfsSjEmpTypeInfo",method=RequestMethod.GET)
				public @ResponseBody Map<String,Object> queryAgcfsSjEmpType(HttpServletRequest request,HttpServletResponse response,Model model ){
					Map<String, Object> result=new HashMap<String, Object>();
					//String coName="ert";
					String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
					System.out.println(coName);
					//String ND="2015";
					String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
				
						String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
						System.out.println(DW_CODE);
						Map<String,Object> param=new HashMap<String, Object>();
						param.put("DW_CODE", DW_CODE);
						param.put("ND", ND);
						List<AgcfsSjEmpType> data=agcfsSjAccBookService.selectAgcfsSjEmpType(param);
					if(data!=null){
						result.put("data", data);
						result.put("flag", "success");
						result.put("msg", "查询成功！");
						
					}else{
						result.put("flag", "fail");
						result.put("msg", "查询失败！");			
					}
					return result;
				}
				//查询项目全部信息
				@RequestMapping(value="/agcfsSjProjInfo",method=RequestMethod.GET)
				public @ResponseBody Map<String,Object> queryAgcfsSjProj(HttpServletRequest request,HttpServletResponse response,Model model ){
					Map<String, Object> result=new HashMap<String, Object>();
					//String coName="ert";
					String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
					System.out.println(coName);
					//String ND="2015";
					String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
				
						String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
						System.out.println(DW_CODE);
						Map<String,Object> param=new HashMap<String, Object>();
						param.put("DW_CODE", DW_CODE);
						param.put("ND", ND);
						List<AgcfsSjProj> data=agcfsSjAccBookService.selectAgcfsSjProj(param);
					if(data!=null){
						result.put("data", data);
						result.put("flag", "success");
						result.put("msg", "查询成功！");
						
					}else{
						result.put("flag", "fail");
						result.put("msg", "查询失败！");			
					}
					return result;
				}
				//查询自定义档案项全部信息
				@RequestMapping(value="/agcfsSjUserDefDocInfo",method=RequestMethod.GET)
				public @ResponseBody Map<String,Object> queryAgcfsSjUserDefDoc(HttpServletRequest request,HttpServletResponse response,Model model ){
					Map<String, Object> result=new HashMap<String, Object>();
					//String coName="ert";
					String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
					System.out.println(coName);
					//String ND="2015";
					String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
				
						String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
						System.out.println(DW_CODE);
						Map<String,Object> param=new HashMap<String, Object>();
						param.put("DW_CODE", DW_CODE);
						param.put("ND", ND);
						List<AgcfsSjUserDefDoc> data=agcfsSjAccBookService.selectAgcfsSjUserDefDoc(param);
					if(data!=null){
						result.put("data", data);
						result.put("flag", "success");
						result.put("msg", "查询成功！");
						
					}else{
						result.put("flag", "fail");
						result.put("msg", "查询失败！");			
					}
					return result;
				}
				
				//查询自定义档案值全部信息
				@RequestMapping(value="/agcfsSjUserDefDocValInfo",method=RequestMethod.GET)
				public @ResponseBody Map<String,Object> queryAgcfsSjUserDefDocVal(HttpServletRequest request,HttpServletResponse response,Model model ){
					Map<String, Object> result=new HashMap<String, Object>();
					//String coName="ert";
					String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
					System.out.println(coName);
					//String ND="2015";
					String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
				
						String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
						System.out.println(DW_CODE);
						Map<String,Object> param=new HashMap<String, Object>();
						param.put("DW_CODE", DW_CODE);
						param.put("ND", ND);
						List<AgcfsSjUserDefDocValEntity> data=agcfsSjAccBookService.selectAgcfsSjUserDefDocVal(param);
					if(data!=null){
						result.put("data", data);
						result.put("flag", "success");
						result.put("msg", "查询成功！");
						
					}else{
						result.put("flag", "fail");
						result.put("msg", "查询失败！");			
					}
					return result;
				}
				//查询币种全部信息
				@RequestMapping(value="/agcfsSjCurInfo",method=RequestMethod.GET)
				public @ResponseBody Map<String,Object> queryAgcfsSjCur(HttpServletRequest request,HttpServletResponse response,Model model ){
					Map<String, Object> result=new HashMap<String, Object>();
					//String coName="ert";
					String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
					System.out.println(coName);
					//String ND="2015";
					String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
				
						String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
						System.out.println(DW_CODE);
						Map<String,Object> param=new HashMap<String, Object>();
						param.put("DW_CODE", DW_CODE);
						param.put("ND", ND);
						List<AgcfsSjCurEntity> data=agcfsSjAccBookService.selectAgcfsSjCur(param);
					if(data!=null){
						result.put("data", data);
						result.put("flag", "success");
						result.put("msg", "查询成功！");
						
					}else{
						result.put("flag", "fail");
						result.put("msg", "查询失败！");			
					}
					return result;
				}
	
				//查询汇率类型全部信息
				@RequestMapping(value="/agcfsSjExchangeTypeInfo",method=RequestMethod.GET)
				public @ResponseBody Map<String,Object> queryAgcfsSjExchangeType(HttpServletRequest request,HttpServletResponse response,Model model ){
					Map<String, Object> result=new HashMap<String, Object>();
					//String coName="ert";
					String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
					System.out.println(coName);
					//String ND="2015";
					String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
				
						String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
						System.out.println(DW_CODE);
						Map<String,Object> param=new HashMap<String, Object>();
						param.put("DW_CODE", DW_CODE);
						param.put("ND", ND);
						List<AgcfsSjExchangeTypeEntity> data=agcfsSjAccBookService.selectAgcfsSjExchangeType(param);
					if(data!=null){
						result.put("data", data);
						result.put("flag", "success");
						result.put("msg", "查询成功！");
						
					}else{
						result.put("flag", "fail");
						result.put("msg", "查询失败！");			
					}
					return result;
				}
				//查询记账凭证类型全部信息
				@RequestMapping(value="/agcfsSjVouTypeInfo",method=RequestMethod.GET)
				public @ResponseBody Map<String,Object> queryAgcfsSjVouType(HttpServletRequest request,HttpServletResponse response,Model model ){
					Map<String, Object> result=new HashMap<String, Object>();
					//String coName="ert";
					String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
					System.out.println(coName);
					//String ND="2015";
					String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
				
						String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
						System.out.println(DW_CODE);
						Map<String,Object> param=new HashMap<String, Object>();
						param.put("DW_CODE", DW_CODE);
						param.put("ND", ND);
						List<AgcfsSjVouTypeEntity> data=agcfsSjAccBookService.selectAgcfsSjVouType(param);
					if(data!=null){
						result.put("data", data);
						result.put("flag", "success");
						result.put("msg", "查询成功！");
						
					}else{
						result.put("flag", "fail");
						result.put("msg", "查询失败！");			
					}
					return result;
				}
				//总账基础信息
				@RequestMapping(value="/agcfsSjGlDefInfo",method=RequestMethod.GET)
				public @ResponseBody Map<String,Object> queryAgcfsSjGlDef(HttpServletRequest request,HttpServletResponse response,Model model ){
					Map<String, Object> result=new HashMap<String, Object>();
					//String coName="ert";
					String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
					System.out.println(coName);
					//String ND="2015";
					String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
				
						String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
						System.out.println(DW_CODE);
						Map<String,Object> param=new HashMap<String, Object>();
						param.put("DW_CODE", DW_CODE);
						param.put("ND", ND);
						List<AgcfsSjGlDefEntity> data=agcfsSjAccBookService.selectAgcfsSjGlDef(param);
					if(data!=null){
						result.put("data", data);
						result.put("flag", "success");
						result.put("msg", "查询成功！");
						
					}else{
						result.put("flag", "fail");
						result.put("msg", "查询失败！");			
					}
					return result;
				}
				//查询会计科目全部信息
				@RequestMapping(value="/agcfsSjAccInfo",method=RequestMethod.GET)
				public @ResponseBody Map<String,Object> queryAgcfsSjAcc(HttpServletRequest request,HttpServletResponse response,Model model ){
					Map<String, Object> result=new HashMap<String, Object>();
					//String coName="ert";
					String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
					System.out.println(coName);
					//String ND="2015";
					String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
				
						String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
						System.out.println(DW_CODE);
						Map<String,Object> param=new HashMap<String, Object>();
						param.put("DW_CODE", DW_CODE);
						param.put("ND", ND);
						List<AgcfsSjAccEntity> data=agcfsSjAccBookService.selectAgcfsSjAcc(param);
					if(data!=null){
						result.put("data", data);
						result.put("flag", "success");
						result.put("msg", "查询成功！");
						
					}else{
						result.put("flag", "fail");
						result.put("msg", "查询失败！");			
					}
					return result;
				}
				//查询科目辅助核算全部信息
				@RequestMapping(value="/agcfsSjAccAssInfo",method=RequestMethod.GET)
				public @ResponseBody Map<String,Object> queryAgcfsSjAccAss(HttpServletRequest request,HttpServletResponse response,Model model ){
					Map<String, Object> result=new HashMap<String, Object>();
					//String coName="ert";
					String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
					System.out.println(coName);
					//String ND="2015";
					String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
				
						String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
						System.out.println(DW_CODE);
						Map<String,Object> param=new HashMap<String, Object>();
						param.put("DW_CODE", DW_CODE);
						param.put("ND", ND);
						List<AgcfsSjAccAssEntity > data=agcfsSjAccBookService.selectAgcfsSjAccAss(param);
					if(data!=null){
						result.put("data", data);
						result.put("flag", "success");
						result.put("msg", "查询成功！");
						
					}else{
						result.put("flag", "fail");
						result.put("msg", "查询失败！");			
					}
					return result;
				}
				//查询固定资产类别全部信息
				@RequestMapping(value="/agcfsSjAssetTypeInfo",method=RequestMethod.GET)
				public @ResponseBody Map<String,Object> queryAgcfsSjAssetType(HttpServletRequest request,HttpServletResponse response,Model model ){
					Map<String, Object> result=new HashMap<String, Object>();
					//String coName="ert";
					String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
					System.out.println(coName);
					//String ND="2015";
					String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
				
						String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
						System.out.println(DW_CODE);
						Map<String,Object> param=new HashMap<String, Object>();
						param.put("DW_CODE", DW_CODE);
						param.put("ND", ND);
						List<AgcfsSjAssetTypeEntity> data=agcfsSjAccBookService.selectAgcfsSjAssetType(param);
					if(data!=null){
						result.put("data", data);
						result.put("flag", "success");
						result.put("msg", "查询成功！");
						
					}else{
						result.put("flag", "fail");
						result.put("msg", "查询失败！");			
					}
					return result;
				}
				//查询固定资产变动方式全部信息
				@RequestMapping(value="/agcfsSjAssetChangeTypeInfo",method=RequestMethod.GET)
				public @ResponseBody Map<String,Object> queryAgcfsSjAssetChangeType(HttpServletRequest request,HttpServletResponse response,Model model ){
					Map<String, Object> result=new HashMap<String, Object>();
					//String coName="ert";
					String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
					System.out.println(coName);
					//String ND="2015";
					String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
				
						String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
						System.out.println(DW_CODE);
						Map<String,Object> param=new HashMap<String, Object>();
						param.put("DW_CODE", DW_CODE);
						param.put("ND", ND);
						List<AgcfsSjAssetChangeTypeEntity> data=agcfsSjAccBookService.selectAgcfsSjAssetChangeType(param);
					if(data!=null){
						result.put("data", data);
						result.put("flag", "success");
						result.put("msg", "查询成功！");
						
					}else{
						result.put("flag", "fail");
						result.put("msg", "查询失败！");			
					}
					return result;
				}
				//查询固定资产使用状况全部信息
				@RequestMapping(value="/agcfsSjAssetStatusInfo",method=RequestMethod.GET)
				public @ResponseBody Map<String,Object> queryAgcfsSjAssetStatus(HttpServletRequest request,HttpServletResponse response,Model model ){
					Map<String, Object> result=new HashMap<String, Object>();
					//String coName="ert";
					String coName=request.getParameter("CO_NAME");//从前端请求获取co_name数据，名字保持一致。
					System.out.println(coName);
					//String ND="2015";
					String ND=request.getParameter("ND");  //从请求数据中获取nd,名字要保持一致。
				
						String	DW_CODE=agcfsSjAccBookService.selectCoCode(coName);
						System.out.println(DW_CODE);
						Map<String,Object> param=new HashMap<String, Object>();
						param.put("DW_CODE", DW_CODE);
						param.put("ND", ND);
						List<AgcfsSjAssetStatusEntity> data=agcfsSjAccBookService.selectAgcfsSjAssetStatus(param);
					if(data!=null){
						result.put("data", data);
						result.put("flag", "success");
						result.put("msg", "查询成功！");
						
					}else{
						result.put("flag", "fail");
						result.put("msg", "查询失败！");			
					}
					return result;
				}
}
